Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secret JWK k values larger than HMAC-SHA minimums #909

Merged
merged 2 commits into from
Jan 28, 2024
Merged

Conversation

lhazlewood
Copy link
Contributor

@lhazlewood lhazlewood commented Jan 28, 2024

  • Ensured Secret JWK 'k' byte arrays for HMAC-SHA algorithms can be larger than the identified HS* algorithm. This is allowed per https://datatracker.ietf.org/doc/html/rfc7518#section-3.2: "A key of the same size as the hash output ... or larger MUST be used with this algorithm"

  • Ensured that, when using the JwkBuilder, Secret JWK 'alg' values would automatically be set to 'HS256', 'HS384', or 'HS512' if the specified Java SecretKey algorithm name equals a JCA standard name (HmacSHA256, HmacSHA384, etc) or JCA standard HMAC-SHA OID.

  • Updated CHANGELOG.md accordingly.

Fixes #905

…arger than the identified HS* algorithm. This is allowed per https://datatracker.ietf.org/doc/html/rfc7518#section-3.2: "A key of the same size as the hash output ... _or larger_ MUST be used with this algorithm"

- Ensured that, when using the JwkBuilder, Secret JWK 'alg' values would automatically be set to 'HS256', 'HS384', or 'HS512' if the specified Java SecretKey algorithm name equals a JCA standard name (HmacSHA256, HmacSHA384, etc) or JCA standard HMAC-SHA OID.

Fixes #901.
@lhazlewood lhazlewood added this to the 0.12.4 milestone Jan 28, 2024
@lhazlewood lhazlewood changed the title Secret JWK 'k' byte arrays lengths larger than HMAC-SHA minimums Secret JWK 'k' byte array lengths larger than HMAC-SHA minimums Jan 28, 2024
…arger than the identified HS* algorithm. This is allowed per https://datatracker.ietf.org/doc/html/rfc7518#section-3.2: "A key of the same size as the hash output ... _or larger_ MUST be used with this algorithm"

- Ensured that, when using the JwkBuilder, Secret JWK 'alg' values would automatically be set to 'HS256', 'HS384', or 'HS512' if the specified Java SecretKey algorithm name equals a JCA standard name (HmacSHA256, HmacSHA384, etc) or JCA standard HMAC-SHA OID.
- Updated CHANGELOG.md accordingly.
@lhazlewood lhazlewood changed the title Secret JWK 'k' byte array lengths larger than HMAC-SHA minimums Secret JWK k values larger than HMAC-SHA minimums Jan 28, 2024
@lhazlewood lhazlewood merged commit 7bac086 into master Jan 28, 2024
24 checks passed
@lhazlewood lhazlewood deleted the issue-905 branch January 28, 2024 03:54
lhazlewood added a commit that referenced this pull request Jan 28, 2024
- Ensured Secret JWK 'k' byte arrays for HMAC-SHA algorithms can be larger than the identified HS* algorithm. This is allowed per https://datatracker.ietf.org/doc/html/rfc7518#section-3.2: "A key of the same size as the hash output ... _or larger_ MUST be used with this algorithm"

- Ensured that, when using the JwkBuilder, Secret JWK 'alg' values would automatically be set to 'HS256', 'HS384', or 'HS512' if the specified Java SecretKey algorithm name equals a JCA standard name (HmacSHA256, HmacSHA384, etc) or JCA standard HMAC-SHA OID.

- Updated CHANGELOG.md accordingly.

Fixes #905
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Impossible to build a JWK with alg: HS512 and a k that is larger than 64 bytes
1 participant